public class Client {
    public static void main(String[] args) {
        try {
            EmployeeList list = new EmployeeList();

            FulltimeEmployee employee1 = new FulltimeEmployee();
            employee1.setName("员工-小明");
            employee1.setWorkTime(30);

            FulltimeEmployee employee2 = new FulltimeEmployee();
            employee2.setName("员工-小黄");
            employee2.setWorkTime(25);

            FulltimeEmployee employee3 = new FulltimeEmployee();
            employee3.setName("员工-小白");
            employee3.setWorkTime(35);

            ParttimeEmployee employee4 = new ParttimeEmployee();
            employee4.setName("实习生-小蓝");
            employee4.setWorkTime(24);

            ParttimeEmployee employee5 = new ParttimeEmployee();
            employee5.setName("实习生-小红");
            employee5.setWorkTime(23);

            list.addEmployee(employee1);
            list.addEmployee(employee2);
            list.addEmployee(employee3);
            list.addEmployee(employee4);
            list.addEmployee(employee5);

            ReadClassNameFromXML avaliableXMl = new ReadClassNameFromXML();
            String filePath="src//config.xml";

            Class classOfDepartment = Class.forName(avaliableXMl.getClassName(filePath));
            Object objectOfDepartment = classOfDepartment.newInstance();
            Department department = (Department) objectOfDepartment;
            if(avaliableXMl.getClassName(filePath)=="HRDepartment"){
                System.out.println("人力资源部负责为职工记工时");
            }
            else{
                System.out.println("财务部负责为职工记职工这周的薪水");
            }


            list.accept(department);
        }
        catch (Exception e) {

        }
        finally {

        }
    }
}
